package com.pkx.guide.record.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pkx.guide.common.annotation.ORpose;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pkx.guide.record.entity.TRecordGuideStatus;
import com.pkx.guide.record.service.TRecordGuideStatusService;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import com.pkx.guide.common.annotation.Log;
import com.pkx.guide.common.enums.BusinessType;
import lombok.extern.slf4j.Slf4j;

/**
 * 诱导屏状态检测记录表 控制器
 *
 * @author sunsy
 * @since 2023-11-14
 */
@RestController
@RequestMapping("/record/status")
@Tag(name = "诱导屏状态检测记录表")
@Slf4j
@ORpose
public class TRecordGuideStatusController {

    @Autowired
    private TRecordGuideStatusService tRecordGuideStatusService;

    @Operation(summary = "诱导屏状态检测记录表分页列表")
    @GetMapping("/page")
    public IPage<TRecordGuideStatus> page(Page page, TRecordGuideStatus tRecordGuideStatus) {
        return tRecordGuideStatusService.pageList(page,tRecordGuideStatus);
    }

    @Operation(summary = "诱导屏状态检测记录表列表")
    @GetMapping("/list")
    public List<TRecordGuideStatus> list(TRecordGuideStatus tRecordGuideStatus) {
        return tRecordGuideStatusService.listByEntity(tRecordGuideStatus);
    }

    @Operation(summary = "诱导屏状态检测记录表详情")
    @GetMapping(value = "/{id}")
    public TRecordGuideStatus selectById(@PathVariable("id") Integer id) {
        return tRecordGuideStatusService.selectById(id);
    }

    @Operation(summary = "诱导屏状态检测记录表新增")
    @PostMapping("/")
    @Log(title = "诱导屏状态检测记录表", businessType = BusinessType.INSERT)
    public Boolean add(@RequestBody TRecordGuideStatus tRecordGuideStatus) {
        return tRecordGuideStatusService.saveTRecordGuideStatus(tRecordGuideStatus);
    }

    @Operation(summary = "诱导屏状态检测记录表修改")
    @PutMapping("/")
    @Log(title = "诱导屏状态检测记录表", businessType = BusinessType.UPDATE)
    public Boolean modify(@RequestBody TRecordGuideStatus tRecordGuideStatus) {
        return tRecordGuideStatusService.modify(tRecordGuideStatus);
    }

    @Operation(summary = "诱导屏状态检测记录表删除(单个条目)")
    @DeleteMapping(value = "/{id}")
    @Log(title = "诱导屏状态检测记录表", businessType = BusinessType.DELETE)
    public Boolean deleteById(@PathVariable("id") Integer id) {
        return tRecordGuideStatusService.deleteById(id);
    }
}
